<?php

/*
Add Item (admin_add_item.php)
*/

$page_title = "Add Item";
$rank_check = 7;
include "../header.inc.php";

$game=$_GET['game'];

print "$openHTML";

$findShops = mysql_query("SELECT * FROM official_shops2 WHERE game = '$game'");
while ($getShops = mysql_fetch_array($findShops))
{
	$shopList .= "<option value=$getShops[id]>$getShops[shop_name]";
}

$itemTypes = "
<OPTION value=food>Food</option>
<OPTION value=health_potion>Health Potion</option>
<OPTION value=battle_item>Battle Item</option>
<OPTION value=level_inc>Raise Level</option>
<OPTION value=strength_inc>Raise Strength</option>
<OPTION value=speed_inc>Raise Speed</option>
<OPTION value=defence_inc>Raise Defence</option>
<OPTION value=intel_inc>Book</option>
<OPTION value=toy>Toy</option>
<OPTION value=pet_look>Change Pet Look</option>
";

$battleTypes = "
<OPTION value=attack>Attack</option>
<OPTION value=defence>Defence</option>
<OPTION value=lower_acc>Lower Accuracy</option>
<OPTION value=raise_acc>Raise Accuracy</option>
<OPTION value=double_damage>Double Damage</option>
";

ECHO <<<END

<FORM ACTION="admin_add_item.pro.php?game=$game" enctype="multipart/form-data" METHOD=POST>
   <P align=center><TABLE BGCOLOR="$tableOutline" CELLSPACING=1 width=450>
      <TR BGCOLOR="$topAndBottomBG" height=25 width=100%>
         <TD COLSPAN=2 HEIGHT=45>
            <CENTER><FONT SIZE="+2" COLOR="$topAndBottomText"><B>--General
            Info--</B></FONT></CENTER>
         </TD>
      </TR>
      <TR BGCOLOR="$maincellColor" height=25 width=100%>
         <TD>
            <P>Item Name:</P>
         </TD>
         <TD>
            <P><INPUT TYPE=text NAME="item_name" VALUE="" SIZE=40 maxsize=32></P>
         </TD>
      </TR>
      <TR BGCOLOR="$middleBG" height=25 width=100%>
         <TD>
            <P>Image:</P>
         </TD>
         <TD>
            <P><input type=file name=itemImage></P>
         </TD>
      </TR>
      <TR BGCOLOR="$maincellColor" height=25 width=100%>
         <TD>
            <P>Description:</P>
         </TD>
         <TD>
            <P><INPUT TYPE=text NAME="item_desc" VALUE="" SIZE=40></P>
         </TD>
      </TR>
      <TR BGCOLOR="$middleBG" height=25 width=100%>
         <TD>
            <P>Rarity:</P>
         </TD>
         <TD>
            <P><select name=rarity><option>Choose a Rarity
            <option value=1>Common
            <option value=2>Uncommon
            <option value=3>Semi Rare
            <option value=4>Rare
            <option value=5>Super Rare
            <option value=6>Ultra Rare
            <option value=7>1 of a kind!
            </select>
         </TD>
      </TR>
      <TR BGCOLOR="$maincellColor" height=25 width=100%>
         <TD>
            <P>Magic Number:</P>
         </TD>
         <TD>
            <P><INPUT TYPE=text NAME="magic_number" VALUE="" SIZE=20>
            <a href=help.php?game=$game&help=magic_number>HUH??</a></P>
         </TD>
      </TR>
      <TR BGCOLOR="$middleBG" height=25 width=100%>
         <TD>
            <P>Value:</P>
         </TD>
         <TD>
            <P><INPUT TYPE=text NAME=value VALUE="1" SIZE=20> (Approx.
            value in $pointsVar)</P>
         </TD>
      </TR>
      <TR BGCOLOR="$maincellColor" height=25 width=100%>
         <TD>
            <P>Item Type:</P>
         </TD>
         <TD>
            <P><SELECT NAME="item_type">
               <OPTION>-----
				$itemTypes
            </SELECT><a href=help.php?game=$game&help=item_types>HUH??</a></P>
         </TD>
      </TR>
      <TR BGCOLOR="$middleBG" height=25 width=100%>
         <TD>
            <P>Parts</P>
         </TD>
         <TD>
            <INPUT TYPE=text NAME="item_parts" VALUE="1" SIZE=20></P>
         </TD>
      </TR>
      <TR BGCOLOR="$maincellColor" height=25 width=100%>
         <TD>
            <P>Retired:</P>
         </TD>
         <TD>
            <P><INPUT TYPE=checkbox NAME=retired VALUE=1>
            (Checked = Retired)</P>
         </TD>
      </TR>
      <TR BGCOLOR="$middleBG" height=25 width=100%>
         <TD>
            <P>Sell In Shops?</P>
         </TD>
         <TD>
            <P><INPUT TYPE=checkbox NAME="sell_in_shops" VALUE=1>
            (Checked = Yes)</P>
         </TD>
      </TR>
            <TR BGCOLOR="$maincellColor" height=25 width=100%>
         <TD>
            <P>Battle item?</P>
         </TD>
         <TD>
            <P><INPUT TYPE=checkbox NAME="battle_item" VALUE=1>
            (Checked = Yes)</P>
         </TD>
      </TR>
      <TR BGCOLOR="$topAndBottomBG" height=25 width=100%>
         <TD COLSPAN=2 HEIGHT=45>
            <CENTER><FONT SIZE="+2" COLOR="$topAndBottomText"><B>--Shop
            Info--</B><BR>
            </FONT><FONT SIZE="-1" COLOR="$topAndBottomText">(Fill out this
            only if "Sell In Shops?" above is
            checked)</FONT></CENTER>
         </TD>
      </TR>
      <TR BGCOLOR="$maincellColor" height=25 width=100%>
         <TD>
            <P>Cost:</P>
         </TD>
         <TD>
            <P><INPUT TYPE=text NAME="item_cost" VALUE="" SIZE=20>
            (In $pointsVar)</P>
         </TD>
      </TR>
      <TR BGCOLOR="$middleBG" height=25 width=100%>
         <TD>
            <P>Max Stock:</P>
         </TD>
         <TD>
            <P><INPUT TYPE=text NAME="max_stock" VALUE="" SIZE=20></P>
         </TD>
      </TR>
      <TR BGCOLOR="$maincellColor" height=25 width=100%>
         <TD>
            <P>Sell In:</P>
         </TD>
         <TD>
            <P><SELECT NAME="sell_in">
               <OPTION>Choose a Shop
               $shopList
            </SELECT></P>
         </TD>
      </TR>
      <TR BGCOLOR="$topAndBottomBG" height=25 width=100%>
         <TD COLSPAN=2 HEIGHT=45>
            <CENTER><FONT SIZE="+2" COLOR="$topAndBottomText"><B>--Battle
            Info--</B><BR>
            </FONT><FONT SIZE="-1" COLOR="$topAndBottomText">(Fill out this
            only if "Battle Item?" above is
            checked)</FONT></CENTER>
         </TD>
      </TR>
      <TR BGCOLOR="$maincellColor" height=25 width=100%>
         <TD>
            <P>Battle Type:</P>
         </TD>
         <TD>
            <P><SELECT NAME="battle_type">
               <OPTION>-----
				$battleTypes
            </SELECT><a href=help.php?game=$game&help=battle_types>HUH??</a></P>
         </TD>
      </TR>
      <TR BGCOLOR="$maincellColor" height=25 width=100%>
         <TD>
            <P>Uses:</P>
         </TD>
         <TD>
            <P><INPUT TYPE=text NAME="battle_uses" VALUE="1" SIZE=20> <a href=help.php?game=$game&help=battle_uses>TIPS!</a></P>
         </TD>
      </TR>
      <TR BGCOLOR="$topAndBottomBG" height=25 width=100%>
         <TD COLSPAN=2>
            <CENTER><INPUT TYPE=submit NAME=Submit VALUE="Add Item!"></CENTER>
         </TD>
      </TR>
   </TABLE>

</FORM></P>

END;

print $closeHTML;

?>
